]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Filter redundant FocusTracker::position-changed signals
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 17 Sep 2018 19:04:48 +0000 (21:04 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 25 Sep 2018 23:49:42 +0000 (23:49 +0000)
Just emit the signal if it did actually change.

js/ui/keyboard.js

index 44660be5442bb3377ddbc176c975bc73175f34b5..be0146344eb6eb33a53a550cfd76b68df3417526 100644 (file)
@@ -492,6 +492,7 @@ var FocusTracker = new Lang.Class({
 
     _init() {
         this._currentWindow = null;
+        this._rect = null;
 
         global.display.connect('notify::focus-window', () => {
             this._setCurrentWindow(global.display.focus_window);
@@ -535,6 +536,13 @@ var FocusTracker = new Lang.Class({
             rect.y -= frameRect.y;
         }
 
+        if (this._rect &&
+            this._rect.x == rect.x &&
+            this._rect.y == rect.y &&
+            this._rect.width == rect.width &&
+            this._rect.height == rect.height)
+            return;
+
         this._rect = rect;
         this.emit('position-changed');
     },